package com.ttbj.location.service;

import java.util.Map;
import org.json.JSONObject;
import org.springframework.stereotype.Component;

import com.ttbj.constant.YingYan;

@Component
public interface LocationComponent {
	static final Long SECOND = 1000L;
	static final Long MINUTE = 60L * 1000L;
	static final Long TIME_NUMBER = 200L;

	Map<String, String> genRequestMap();

	default Map<String, String> getAroundSearchRequestMap(String lng, String lat) {
		Map<String, String> map = genRequestMap();
		map.put("center", new StringBuffer(lat).append(",").append(lng).toString());
		map.put("radius", YingYan.RADIUS);
		map.put("coord_type_input", YingYan.COORD_TYPE_TX);
		map.put("coord_type_output", YingYan.COORD_TYPE_TX);
		map.put("filter", "active_time:" + String.valueOf((System.currentTimeMillis() - TIME_NUMBER * MINUTE) / SECOND));
		return map;
	}
	
	
	
	JSONObject isSuccess(String json);

}
